﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProductAdd.aspx.cs" Inherits="WebSite.admin.order.ProductAdd" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

   <head id="Head1" runat="server">
    <title>良臣直销网 -订单管理-添加商品</title>
    <link href="../main.css" rel="stylesheet" type="text/css" />
    
    <script language="javascript" type="text/javascript">

        function SetAmount(id) {

          var oAmount =  document.getElementById(id.substring(0,id.length - 7) +  "_lblAmount");
          var oNum = document.getElementById(id);
          var oPrice = document.getElementById(id.substring(0, id.length - 7) + "_lblPrice");
          if (!isNaN(oNum.value)) {
              if (oNum.value <= 0) {
                  oNum.value = 1;
              }
          }
          oNum.value = parseInt(oNum.value);
          oAmount.innerHTML = oNum.value * oPrice.innerHTML;    
        } 
    
   </script>

</head>

<body>
    <form id="form1" runat="server">
    <div>
    <br />
  <table Width="98%" border="0" cellspacing="0" cellpadding="3">
    <tr>
    <td>&nbsp;
         余额：<%= RemanantsAmount.ToString()%>
    </td>
    </tr>
    <tr>
    <td>
     
     <asp:GridView ID="GridView1" runat="server" Width="98%" CellPadding="4" 
            ForeColor="#333333" DataKeyNames="proid" AutoGenerateColumns="False" 
            AllowPaging="false" pagesize="100" BorderStyle="Solid" BorderWidth="1px" 
      ShowFooter="false" EmptyDataText="没有数据记录！！" AllowSorting="True" 
            onrowcommand="GridView1_RowCommand" >
        <Columns>
        
        <asp:HyperLinkField DataNavigateUrlFields="proid"  DataNavigateUrlFormatString="orders.aspx?oid={0}" HeaderText="产品号" DataTextField="proid"  ItemStyle-Width="100px"/>
           <asp:TemplateField  HeaderText="产品介绍">
           <ItemStyle VerticalAlign="Middle"  />
             <ItemTemplate>
             <a href='/cn/products_details.aspx?pid=<%#Eval("proid")%>' target='_blank'>
            <%# Eval("proname")%></a> 
             </ItemTemplate>
        </asp:TemplateField>
          <asp:TemplateField  HeaderText="数量">
           <ItemStyle  HorizontalAlign="Center"  Width="50px" />
             <ItemTemplate>
             <asp:TextBox ID="txtNum" runat="server" Text="1"  onMouseOut="SetAmount(this.id)" Width="30px"></asp:TextBox>
             </ItemTemplate>
        </asp:TemplateField>

             <asp:TemplateField  HeaderText="价格">
           <ItemStyle  HorizontalAlign="Right"  Width="60px" />
             <ItemTemplate>
             <asp:Label ID="lblPrice" runat="server" Text='<%#Eval("proprice3")%>' Width="30px"></asp:Label>
             </ItemTemplate>
        </asp:TemplateField>
            <asp:TemplateField  HeaderText="总价">
           <ItemStyle  HorizontalAlign="Right"  Width="60px" />
             <ItemTemplate>
             <asp:Label ID="lblAmount" runat="server" Text='<%#Eval("proprice3")%>'  ></asp:Label>
             </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField  HeaderText="操作" ItemStyle-Width="80px" ItemStyle-HorizontalAlign="Center">
             <ItemTemplate>
             <asp:LinkButton id="lbtnAdd" Text="添加" CommandName="add" CommandArgument='<%# Container.DataItemIndex %>'  runat="server"></asp:LinkButton>  
             </ItemTemplate>
        </asp:TemplateField>
         
      
        </Columns>
             <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />             
             <PagerStyle BackColor="White" ForeColor="#333333" HorizontalAlign="Center" Font-Bold="True" Font-Size=30px />
             <HeaderStyle BackColor="#E2E7EB" Font-Bold="True" ForeColor="Black" HorizontalAlign="Left" />
             <AlternatingRowStyle BackColor="White" />
             <PagerSettings Visible="False" />
    </asp:GridView>

    </td>
    </tr>
    
  </table>
    
    </div>
    </form>
</body>
</html>
